package com.ruoyi.business.domain.bo.admin;

import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import com.ruoyi.common.core.validate.Type1Group;
import com.ruoyi.common.core.validate.Type2Group;
import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;

/**
 * 改价业务对象
 *
 * @author 99
 * @date 2024-04-21
 */
@Data
public class AdminPriceEditBo {

    /**
     * 主键
     */
    @NotNull(message = "主表id不能为空", groups = {Type1Group.class, Type2Group.class})
    private Long masterId;

    /**
     * 费用类型名称
     */
    @NotNull(message = "费用类型不能为空", groups = {Type1Group.class})
    @NotEmpty(message = "费用类型不能为空", groups = {Type1Group.class})
    private String name;

    /**
     * 改价后价格
     */
    @NotNull(message = "修改后价格不能为空", groups = {Type1Group.class, Type2Group.class})
    @Digits(integer = 8, fraction = 2, message = "修改后价格超出最大金额",groups = {AddGroup.class, EditGroup.class,Type1Group.class, Type2Group.class})
    @DecimalMin(value = "0.01", message = "修改后价格不能低于0.01元", groups = {AddGroup.class, EditGroup.class,Type1Group.class, Type2Group.class})
    private BigDecimal price;

    /**
     * 改价理由
     */
    @Size(max = 20, message = "备注最大长度要小于 20个字符")
    private String remark;

}
